<html>
    <body>
        <form id="myform" method="post" action="">
            <p>
                <label for="myname">用户名：</label>
                <input id="myname" name="myname">
            </p>
            <p>
                <label for="email">E-Mail：</label>
                <input id="email" name="email" />
            </p>
            <p>
                <label for="password">登陆密码：</label>
                <input id="password" name="password" type="password" />
            </p>
            <p>
                <label for="confirm_password">确认密码：</label>
                <input id="confirm_password" name="confirm_password" type="password" />
            </p>
            <p>
                <input class="submit" type="submit" value="立即注册" />
            </p>
        </form>
    </body>
    <script type="text/javascript" src="./js/jquery.min.js"></script>
    <script type="text/javascript" src="./js/jquery.validate.js"></script>
    <script type="text/javascript" src="./js/messages_cn.js"></script>
    <script type="text/javascript" src="./js/additional-methods.js"></script>
    <script type="text/javascript">
    $(function(){
        $("#myform").validate({
            debug: true,
        	rules:{
        		myname:{
        			required:true,
        			isZipCode:true
        		}
        		
        	},
            messages:{
            	myname:{
            		required:'请输入用户名',
            		maxlength:$.validator.format("用户名不能超过 {0}"),
            	}
            },
        	submitHandler: function(form){
                alert("提交表单");
            }, 
   		});
        
    });
    </script>
</html>